<?php
if (!defined('IN_XLP')) {
    exit('Access Denied');
}
$Document = array(
    'pageid' => 'platform-add', //页面标示
    'pagename' => '平台添加', //当前页面名称
    'mycss' => array(), //加载的css样式表
    'myjs' => array(), //加载的js脚本
	//'footerjs'=>array('content/highcharts', 'content/exporting',),
	  'footerjs'=>array('content/fuelux/fuelux', 'content/combodate/moment.min'),
    'head' => true, //加载头部文件
);

include getTpl('header', 'public');
?>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<!-- content -->
  <section id="content">
	<section class="main padder"> 
    <div class="clearfix"> 
     <h4><i class="fa fa-edit"></i>平台添加</h4> 
    </div> 
    <div class="row"> 
     <div class="col-sm-12"> 
      <section class="panel"> 
       <div class="panel-body"> 
        <form class="form-horizontal" id="cateAddForm" method="post" > 

         <div class="form-group"> 
          <label class="col-sm-1 control-label">名称</label> 
          <div class="col-sm-2"> 
            <input name="name" id="name" placeholder="名称" class="form-control" data-required="true"  />
          </div> 
         </div> 

         <div class="form-group"> 
          <label class="col-sm-1 control-label">编码</label> 
          <div class="col-sm-2"> 
            <input name="abridge" id="abridge" placeholder="编码" class="form-control" data-required="true"  />
          </div> 
         </div>
         <div class="form-group"> 
          <label class="col-sm-1 control-label">是否收费</label> 
            <div class="row">
              <div class="col-xs-1 radio m-l-large"><label class="radio-custom"> <input type="radio" name="is_charge" checked="checked" value="0" /> <i class="fa fa-circle-o"></i>否</label></div>
              <div class="col-xs-1 radio m-l-large"><label class="radio-custom"> <input type="radio" name="is_charge" value="1" /> <i class="fa fa-circle-o"></i>是</label></div>
            </div>
         </div> 

         <div class="form-group"> 
          <label class="col-sm-1 control-label">外部链接</label> 
          <div class="col-sm-5"> 
            <input name="url"  placeholder="手续费展示链接" class="form-control" data-required="true"  />
          </div> 
         </div>

         <div class="form-group"> 
          <label class="col-sm-1 control-label">状态</label> 
            <div class="row">
              <div class="col-xs-1 radio m-l-large"><label class="radio-custom"> <input type="radio" name="status" checked="checked" value="1" /> <i class="fa fa-circle-o"></i>上架</label></div>
              <div class="col-xs-1 radio m-l-large"><label class="radio-custom"> <input type="radio" name="status" value="2" /> <i class="fa fa-circle-o"></i>下架</label></div>
            </div>
         </div> 

         <div class="form-group"> 
          <label class="col-sm-1 control-label">排序</label> 
          <div class="col-sm-2"> 
            <input type="number" name="sort"  id="sort" placeholder="" class="form-control" value="255" />
          </div> 
         </div> 

         <div class="form-group"> 
          <div class="col-sm-9 col-lg-offset-3"> 
            <div class="col-sm-1"><button type="submit" id="sub-ok" data-loading-text="正在提交..." class="btn btn-primary">保存</button></div>
            <button type="button" class="btn btn-white col-md-offset-1">取消</button> 
          </div> 
         </div> 
        </form> 
       </div> 
      </section>
     </div> 
    </div> 
   </section> 
  </section> 
  <!--/ content --> 
<!--主体 结束-->
<script>
$(function(){
  $('#cateAddForm').submit(function(){


    if (!$('#name').val()){
      Msg.error('请输入名称');
      resetSubmit("#sub-ok",'提交');
      return false;
    }
   
    if (!$('#abridge').val()){
      Msg.error('请输入编码');
      resetSubmit("#sub-ok",'提交');
      return false;
    }

    Msg.loading();
    $.post('<?php echo U('platform/add');?>',$(this).serialize(),function(result){
      Msg.hide();
      resetSubmit("#sub-ok",'提交');
      if (result.status==1){
       Msg.ok(result.info);  
    }else{
      Msg.error(result.info);
    }
    },'json');
    return false;
  });

})
</script>
<?php
include getTpl('footer', 'public');
?>